package com.ccf.business.knowledge.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * 描述：
 * 资源调用客户端
 * @author xianggj
 * @Date 2022/2/21 18:22
 **/
@FeignClient("business-source")
@Component
public interface SourceClient {

    /**
     * 返回文件数据
     * @param sid
     * @return
     */
    @RequestMapping(value = "/source/remote/getDataPath", method = RequestMethod.GET,produces = MediaType.TEXT_PLAIN_VALUE)
    String getDataPath(@RequestParam("sid") String sid);

    /**
     * 返回文件预览路径
     * @param sid
     * @return
     */
    @RequestMapping(value = "/source/remote/getViewPath", method = RequestMethod.GET,produces = MediaType.TEXT_PLAIN_VALUE)
    String getViewPath(@RequestParam("sid") String sid);

    /**
     * 返回文件名称
     * @param sid
     * @return
     */
    @RequestMapping(value = "/source/remote/getName", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
    String getName(@RequestParam("sid") String sid);

    /**
     * 返回文件名称映射
     * @return
     */
    @RequestMapping(value = "/source/remote/getNameMap", method = RequestMethod.GET)
    Map<String, String> getNameMap();
    /**
     * 返回文件路径映射
     * @return
     */
    @RequestMapping(value = "/source/remote/getDataPathMap", method = RequestMethod.GET)
    Map<String, String> getDataPathMap();
}
